Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: custom root certificate support #19

Merged
merged 45 commits into from
Jul 2, 2024
Merged

Conversation

DaniAkash
Copy link
Contributor

@DaniAkash DaniAkash commented Jul 2, 2024

This pull request primarily introduces changes to the ClarifaiAuthHelper class in src/client/auth/helper.ts to support the use of root SSL certificates for secure gRPC connections. The changes also include updates to related files like src/client/base.ts, src/utils/types.ts, and corresponding unit tests.

The most important changes are:

Addition of new functionality:

  • src/client/auth/helper.ts: Added a new private member _rootCertificatesPath in the ClarifaiAuthHelper class to store the path to the root SSL certificates file. This path is passed as a new parameter in the constructor and is used to create a secure gRPC client if provided. [1] [2] [3]
  • src/client/auth/helper.ts: Added a new getter method rootCertificatesPath to return the root certificates path.
  • src/client/auth/helper.ts: Added a check in the constructor to validate the existence of the root certificates file if a path is provided.
  • src/client/base.ts: Added a new protected member rootCertificatesPath in the BaseClient class to store the root certificates path obtained from the ClarifaiAuthHelper. [1] [2]

Changes to existing functionality:

  • src/client/rag.ts: Changed the default value of the baseWorkflow parameter in the RAG class constructor from "Text" to "Universal".

Updates to types and tests:

These changes enhance the flexibility of the gRPC client configuration by allowing it to use custom SSL root certificates when needed.

Copy link
Contributor

github-actions bot commented Jul 2, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 64.98%
⬆️ +0.03%
4642 / 7143
🔵 Statements 64.98%
⬆️ +0.03%
4642 / 7143
🔵 Functions 68.06%
⬆️ +0.17%
130 / 191
🔵 Branches 64.41%
⬆️ +0.01%
362 / 562
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/client/base.ts 86.08% 66.66% 66.66% 86.08% 60, 100-114
src/client/auth/helper.ts 76.08% 72.91% 78.94% 76.08% 29-40, 43-45, 58-68, 172-191, 223-226, 237-238, 246-251, 256-272, 282-283, 289-290, 321-322, 327, 330-333, 347-348, 384-387, 389-390
src/utils/types.ts 0% 0% 0% 0% 1-27
Generated in workflow #48

@DaniAkash DaniAkash merged commit 8b517f4 into main Jul 2, 2024
5 checks passed
@DaniAkash DaniAkash deleted the dani/custom-root-ca branch July 2, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants